package com.itgaoshu.hospitalproject.service.impl;

import com.itgaoshu.hospitalproject.bean.*;
import com.itgaoshu.hospitalproject.mapper.LadminMapper;
import com.itgaoshu.hospitalproject.service.LadminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class LadminServiceImpl implements LadminService {
    @Autowired
    private LadminMapper ladminMapper;
    //查询未出院的所有的患者
    @Override
    public List<Register> selRegister(Register register) {
        return ladminMapper.selRegister(register);
    }

    //添加住院的患者的信息
    @Override
    public int addRegister(Register register) {
        return ladminMapper.addRegister(register);
    }
    //查询所有的科室信息
    @Override
    public List<Departments> selDepartment() {
        return ladminMapper.selDepartment();
    }
    //根据科室查询该科室下的医生以及属于住院部的dstate=1
    @Override
    public List<Doctor> selDoctor(Integer departmentId) {
        return ladminMapper.selDoctor(departmentId);
    }

    //根据科室查询没有入住的床位信息
    @Override
    public List<Bed> selBed(Bed bed) {
        return ladminMapper.selBed(bed);
    }

    //查询医保折扣的信息
    @Override
    public List<Moneytype> selDis() {
        return ladminMapper.selDis();
    }

    //查询待转院的所有患者的信息从门诊传过来的信息
    @Override
    public List<Register> selDoor() {
        return ladminMapper.selDoor();
    }

    //将门诊部门待入院状态改为已入院状态根据reportId
    @Override
    public int updateZ(Register register) {
        return ladminMapper.updateZ(register);
    }

    //已入院的时候修改床位的信息，显示已占用该床位
    @Override
    public int updateBed(Register register) {
        return ladminMapper.updateBed(register);
    }
    //转科室的方法
    @Override
    public int updateKe(Register register){
        return ladminMapper.updateKe(register);
    }
}
